package wow.data
{
	import mx.collections.ArrayList;
	
	import wow.Datas;

	public class Enemy extends Unit
	{
		[Bindable] public var spellSequence:Array;
		[Bindable] public var spellIndex:int;
		[Bindable] public var target:Unit;
		
		public function Enemy(name:String,clazz:int,spec:String,maxLife:int,spellSequence:Array)
		{
			super(name,clazz,spec,maxLife);
			this.spellSequence = spellSequence;
			this.spellIndex = 0;
			this.target = null;
		}
		
		/** Obtient le sort courant. */
		public function getSpell():Object
		{
			return spellSequence[spellIndex];
		}
		
		/** Pase au sort suivant. */
		public function nextSpell():void
		{
			spellIndex++;
			if (spellIndex >= spellSequence.length)
			{
				spellIndex = 0;
			}
		}
	}
}